#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int x1;
	int x2, score;
	scanf("%d %d",&x1,&x2);
	if (x1 == 1)
	{
		score = x2 * (1 + 0.3);
	}
	else if (x1 == 2)
	{
		score = x2 * (1 + 0.2);
	}
	else if (x1 == 3)
	{
		score = x2 * (1 + 0.1);
	}
	if (score>=90)
	{
		score = 90;
	}
	if (x2 >= 90)
	{
		score = x2;
	}
	printf("%d", score);
	return 0;
}